<?php

namespace JLPay\Models\Ledger\BalanceSplit;

use JLPay\Models\BaseResponse;

/**
 * 余额查询响应
 */
class BalanceQueryResponse extends BaseResponse
{
    protected ?string $orgCode = null;
    protected ?string $mchId = null;
    protected ?string $accountType = null;
    protected ?string $balance = null;
    protected ?string $availableBalance = null;

    /**
     * 构造函数
     *
     * @param array|null $responseArray
     */
    public function __construct(?array $responseArray = null)
    {
        parent::__construct($responseArray);

        if ($responseArray) {
            $this->orgCode = $responseArray['org_code'] ?? null;
            $this->mchId = $responseArray['mch_id'] ?? null;
            $this->accountType = $responseArray['account_type'] ?? null;
            $this->balance = $responseArray['balance'] ?? null;
            $this->availableBalance = $responseArray['available_balance'] ?? null;
        }
    }

    /**
     * 获取机构代码
     *
     * @return string|null
     */
    public function getOrgCode(): ?string
    {
        return $this->orgCode;
    }

    /**
     * 获取商户号
     *
     * @return string|null
     */
    public function getMchId(): ?string
    {
        return $this->mchId;
    }

    /**
     * 获取账户类型
     *
     * @return string|null
     */
    public function getAccountType(): ?string
    {
        return $this->accountType;
    }

    /**
     * 获取余额
     *
     * @return string|null
     */
    public function getBalance(): ?string
    {
        return $this->balance;
    }

    /**
     * 获取可用余额
     *
     * @return string|null
     */
    public function getAvailableBalance(): ?string
    {
        return $this->availableBalance;
    }
} 